import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { PartialType } from '@nestjs/swagger';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';
import { Column } from 'typeorm';

export class CouponSort_Create_Dto {
  @IsString()
  @IsNotEmpty()
  @ApiProperty({ description: '优惠券分类名称' })
  couponSortName: string;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '选中图片' })
  activeImg?: string;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '非选中图片' })
  rAactiveImg?: string;

  @Column({ nullable: true })
  @ApiProperty({ description: '备注' })
  remark?: string;
}

export class CouponSort_Find_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  size?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  page?: number;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '优惠券名称' })
  couponSortName?: string;
}

export class CouponSort_Update_Dto extends PartialType(CouponSort_Create_Dto) {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  id: number;
}
